package com.soft.mainsite.mybatis.mapper;

import com.soft.mainsite.mybatis.model.TCmsFriendlink;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * TCmsFriendlinkMapper
 *
 * @author Jin
 * @create 2017-06-16
 **/
public interface TCmsFriendlinkMapper extends Mapper<TCmsFriendlink> {

    /**
     * 根据群组id查询友链
     *
     * @param id
     * @return
     */
    @Select("select f.* from t_cms_friendlink f left join t_cms_friendlink_group g on f.group_id = g.id where g.id=#{id} and f.status=1 order by sort_id asc")
    @ResultMap("BaseResultMap")
    List<TCmsFriendlink> selectFriendLinkByGroupId(@Param("id") Integer id);

}